<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<html:html>
<head>
<META http-equiv=Pragma content=no-cache>
<META http-equiv=Cache-Control content=no-cache>
<META http-equiv=Expires content=0>
<title><bean:message key="F0501.title"/></title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../../resource/css/style.css" type="text/css">
<script language="javascript" type="text/javascript" src="../../resource/js/util.js"></script>
<script language="javascript" type="text/javascript" src="../../resource/js/AdyhUtil.js"></script>
<script language="javascript" type="text/javascript" src="../../resource/calendar/DCDA_C03.js"></script>
<script language="javascript" type="text/javascript" src="<%=request.getContextPath()%>/resource/js/Validator.js"></script>	
<script type="text/javascript"
		src="<%=request.getContextPath()%>/style/ext/adapter/ext/ext-base.js"></script>
	<script type="text/javascript"
		src="<%=request.getContextPath()%>/style/ext/ext-all.js"></script>
<script language="javascript1.2">

/**重置*/
function ResetMe()
{	
    document.getElementById("exchangeDate").className = "MyText";
    document.getElementById("euroRmb").className = "MyText";
	document.getElementById("usdRmb").className = "MyText";
    document.getElementById("euroUsd").className = "MyText";

	var objPrompt = document.getElementById("divPrompt");
    objPrompt.style.display = "none";
	objPrompt.innerHTML = "";
}

//保存 判断
function operation1(){
	ResetMe();
	var exchangeDate = document.getElementById("exchangeDate").value;
	var euroRmb = document.getElementById("euroRmb").value;
	var usdRmb = document.getElementById("usdRmb").value;
	var euroUsd = document.getElementById("euroUsd").value;
	
	var submitFlag = true;
	var objPrompt = document.getElementById("divPrompt");
    objPrompt.style.display = "block";
    objPrompt.innerHTML = "";
    
    	if(!isNotNull(Jtrim(euroRmb))){
			objPrompt.innerHTML += "<li><bean:message key="F0501.euro/rmb"/><bean:message key="adyh.error.isnull"/>！";
			document.getElementById("euroRmb").className = "MyControlError";
			submitFlag = false;
		}
		else{
			if(isNumber(euroRmb)){
				objPrompt.innerHTML += "<li><bean:message key="F0501.euro/rmb"/><bean:message key="adyh.error.number"/>！";
				document.getElementById("euroRmb").className = "MyControlError";
				submitFlag = false;
			}
		}
    	
		if(!isNotNull(Jtrim(usdRmb))){
			objPrompt.innerHTML += "<li><bean:message key="F0501.usd/rmb"/><bean:message key="adyh.error.isnull"/>！";
			document.getElementById("usdRmb").className = "MyControlError";
			submitFlag = false;
		}
		else{
			if(isNumber(usdRmb)){
				objPrompt.innerHTML += "<li><bean:message key="F0501.usd/rmb"/><bean:message key="adyh.error.number"/>！";
				document.getElementById("usdRmb").className = "MyControlError";
				submitFlag = false;
			}
		}
		
		if(!isNotNull(Jtrim(euroUsd))){
			objPrompt.innerHTML += "<li><bean:message key="F0501.euro/usd"/><bean:message key="adyh.error.isnull"/>！";
			document.getElementById("euroUsd").className = "MyControlError";
			submitFlag = false;
		}
		else{
			if(isNumber(euroUsd)){
				objPrompt.innerHTML += "<li><bean:message key="F0501.euro/usd"/><bean:message key="adyh.error.number"/>！";
				document.getElementById("euroUsd").className = "MyControlError";
				submitFlag = false;
			}
		}
		
		if(!isNotNull(Jtrim(exchangeDate))){
			objPrompt.innerHTML += "<li><bean:message key="F0501.addDate"/><bean:message key="adyh.error.isnull"/>！";
			document.getElementById("exchangeDate").className = "MyControlError";
			submitFlag = false;
		}

		if(submitFlag==true){
		   if(document.forms[0].layOutType.value=="add"){
	           operation('insert');
	       }else{
	           operation('update');
	       }	
		}	      
}

function ShowFormTitle(strTitle){
	document.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" style=\"height:26px; background-position: left bottom; background-image: url(../../style/images/FormTitle_A_4.gif); background-repeat: repeat-x;\">");
	document.write("  <tr >");
	document.write("	<td style=\"width:5px; background-position: left bottom; background-image: url(../../style/images/FormTitle_A_1.gif); background-repeat: no-repeat;\">&nbsp;&nbsp;&nbsp;</td>");
	document.write("	<td class=\"FormTitle\" style=\"width:100%; padding-left:5px; padding-top:3px; background-position: left bottom; background-image: url(../../style/images/FormTitle_A_2.gif); background-repeat: no-repeat;\">");
	document.write("		<span id=\"spanFormTitle\" class=\"SpanTitle\">"+ strTitle +"</span>");
	document.write("	</td>");
	document.write("	<td style=\"width:5px; background-position: right bottom; background-image: url(../../style/images/FormTitle_A_3.gif); background-repeat: no-repeat;\">&nbsp;&nbsp;&nbsp;</td>");
    document.write("  </tr>");
	document.write("</table>");
}	

</script>
</head>

<body marginheight="0" marginwidth="0" bottommargin="0" topmargin="0">
<html:form method="post" action="/pages/F05/F0501.do" enctype="multipart/form-data">
<html:hidden property="operationType"/>
<html:hidden property="layOutType" />
<html:hidden property="id"/>
<!--Begin：表单标题-->
<div class="DivBlock">
	<script language="javascript" type="text/javascript">
		ShowFormTitle("<bean:message key="F0501.title"/>");
	</script>
</div>
<!--End：表单标题-->
<!--Begin：表单折叠区块1-->
<div class="DivBlock">
<div class="DivWrap">
  <table  WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0">
	<tr>	
		<td align="center"><bean:message key="F0501.addDate"/></td>
		<td><html:text property="exchangeDate" styleClass="MyText" onclick="return CalendarClick(this)"/>
		<span class="Need">*</span></td>
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>		
		<td align="center">&nbsp;</td>
		<td>&nbsp;</td>		
	</tr>
	<tr>
		<td align="center"><bean:message key="F0501.euro/rmb"/></td>
		<td><html:text property="euroRmb" styleClass="MyText"/>
		<span class="Need">*</span></td>		
		<td align="center"><bean:message key="F0501.usd/rmb"/></td>
		<td><html:text property="usdRmb" styleClass="MyText"/>
		<span class="Need">*</span></td>
		<td align="center"><bean:message key="F0501.euro/usd"/></td>
		<td><html:text property="euroUsd" styleClass="MyText"/>
		<span class="Need">*</span></td>
	</tr>
  </table>
</div>
</div>
<!--End：表单折叠区块1-->
<div class="DivBlock">
<div class="DivButton">
  <input type="button" name="Submit1" class="MyButton" value="<bean:message key="common.save"/>" onClick="javascript:operation1();">
  <input type="button" name="Submit2" class="MyButton" value="<bean:message key="common.back"/>" onClick="javascript:operation('back');">
</div>
<div class="DivPrompt" id="divPrompt" style="display:none">
</div>
</div>
</html:form>
</body>
</html:html>